/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UnirseAPartida.java
 *
 * Created on 31/05/2009, 04:17:07 PM
 */

package gui;

import Multimedia.MediaSonido;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;

/**
 *
 * @author Arquitectura
 */
public class UnirseAPartida extends javax.swing.JFrame {

    public  String Usuario;
    public  MediaSonido sonidoLogin;
    private Estadisticas Est;
    private VerPerfilJugador pj;
    private Home gc;
    private ArrayList<String> partidas;
  

    /** Creates new form UnirseAPartida */
    public UnirseAPartida(Home gc, MenuPartida mp, String usuario,MediaSonido sonidoLoginEntrada) {

        this.Usuario = usuario;
        this.sonidoLogin = sonidoLoginEntrada;
        this.gc = gc;
        initComponents();
        this.jtDescripcion.setText("");
        xPnlFondo pnlFondo = new xPnlFondo(13);
        this.add(pnlFondo);
        this.pack();
        this.setSize(800, 635); //El 635 depende (alto) depende del Skin usado.
        this.setLocationRelativeTo(null);
        partidas=gc.getRc().actualizarp();

        for(int i=0;i<partidas.size();i++)
        this.jtDescripcion.append(partidas.get(i));
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jbMenuPrincipal = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtDescripcion = new javax.swing.JTextArea();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jbMenuPrincipal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/volverahome.png"))); // NOI18N
        jbMenuPrincipal.setText("Menu Principal");
        jbMenuPrincipal.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jbMenuPrincipal.setBorderPainted(false);
        jbMenuPrincipal.setContentAreaFilled(false);
        jbMenuPrincipal.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_volverahome_roll.png"))); // NOI18N
        jbMenuPrincipal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbMenuPrincipalActionPerformed(evt);
            }
        });

        jtDescripcion.setColumns(20);
        jtDescripcion.setRows(5);
        jScrollPane1.setViewportView(jtDescripcion);

        jLabel1.setText("P3");
        jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel1MouseClicked(evt);
            }
        });

        jLabel2.setText("P4");
        jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel2MouseClicked(evt);
            }
        });

        jLabel3.setText("P5");

        jLabel4.setText("P6");

        jLabel5.setText("P7");

        jLabel6.setText("P8");

        jLabel7.setText("P9");

        jLabel8.setText("P10");

        jLabel9.setText("P2");
        jLabel9.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel9MouseClicked(evt);
            }
        });

        jLabel10.setText("P1");
        jLabel10.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel10MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(154, 154, 154)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel10)
                    .addComponent(jLabel8)
                    .addComponent(jLabel7)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbMenuPrincipal))
                .addContainerGap(166, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(153, 153, 153)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(12, 12, 12)
                        .addComponent(jLabel9)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel5)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel6)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel7))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jbMenuPrincipal)
                        .addContainerGap(125, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(jLabel8)
                        .addGap(148, 148, 148))))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-800)/2, (screenSize.height-600)/2, 800, 600);
    }// </editor-fold>//GEN-END:initComponents

    private void jbMenuPrincipalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbMenuPrincipalActionPerformed
        // TODO add your handling code here:
        this.dispose();

        //JFrame.setDefaultLookAndFeelDecorated(true);
        //SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin");
        //SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceBinaryWatermark");//Ejemplo de aplicacion de un watermark de Substance
        //SubstanceLookAndFeel.setCurrentWatermark(new SubstanceImageWatermark("http://72.29.81.246/~imindjav/images/Home.jpg"));
        //SubstanceLookAndFeel.setImageWatermarkOpacity(new Float(1));

        gc.setVisible(true);
}//GEN-LAST:event_jbMenuPrincipalActionPerformed

    private void jLabel10MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel10MouseClicked
        // TODO add your handling code here:
      
            TableroM2_1_1 t=new TableroM2_1_1(this.gc);
            t.setVisible(true);
            t.Iniciar(gc.getRc().actualizari().get(0), gc.getRc().Puerto().get(1));

            this.jLabel9.setEnabled(false);
            this.setVisible(false);
    }//GEN-LAST:event_jLabel10MouseClicked

    private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel9MouseClicked
        // TODO add your handling code here:
            Tablero_1 t=new Tablero_1(this.gc);
            t.setVisible(true);
            t.Iniciar(gc.getRc().actualizari().get(1), gc.getRc().Puerto().get(2));

            this.jLabel1.setEnabled(false);
            this.setVisible(false);
    
    }//GEN-LAST:event_jLabel9MouseClicked

    private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked
        // TODO add your handling code here:


            TableroM2_1_1 t=new TableroM2_1_1(this.gc);
            t.setVisible(true);
            t.Iniciar(gc.getRc().actualizari().get(2), gc.getRc().Puerto().get(3));

            this.jLabel9.setEnabled(false);
            this.setVisible(false);


        

    }//GEN-LAST:event_jLabel1MouseClicked

    private void jLabel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseClicked
        // TODO add your handling code here:

            Tablero_1 t=new Tablero_1(this.gc);
            t.setVisible(true);
            t.Iniciar(gc.getRc().actualizari().get(3), gc.getRc().Puerto().get(4));

            this.jLabel1.setEnabled(false);
            this.setVisible(false);

    }//GEN-LAST:event_jLabel2MouseClicked

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        /*
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new UnirseAPartida().setVisible(true);
            }
        });*/
    }

    public JLabel getJLabel1() {
        return jLabel1;
    }

    public void setJLabel1(JLabel jLabel1) {
        this.jLabel1 = jLabel1;
    }

    public JLabel getJLabel10() {
        return jLabel10;
    }

    public void setJLabel10(JLabel jLabel10) {
        this.jLabel10 = jLabel10;
    }

    public JLabel getJLabel2() {
        return jLabel2;
    }

    public void setJLabel2(JLabel jLabel2) {
        this.jLabel2 = jLabel2;
    }

    public JLabel getJLabel3() {
        return jLabel3;
    }

    public void setJLabel3(JLabel jLabel3) {
        this.jLabel3 = jLabel3;
    }

    public JLabel getJLabel4() {
        return jLabel4;
    }

    public void setJLabel4(JLabel jLabel4) {
        this.jLabel4 = jLabel4;
    }

    public JLabel getJLabel5() {
        return jLabel5;
    }

    public void setJLabel5(JLabel jLabel5) {
        this.jLabel5 = jLabel5;
    }

    public JLabel getJLabel6() {
        return jLabel6;
    }

    public void setJLabel6(JLabel jLabel6) {
        this.jLabel6 = jLabel6;
    }

    public JLabel getJLabel7() {
        return jLabel7;
    }

    public void setJLabel7(JLabel jLabel7) {
        this.jLabel7 = jLabel7;
    }

    public JLabel getJLabel8() {
        return jLabel8;
    }

    public void setJLabel8(JLabel jLabel8) {
        this.jLabel8 = jLabel8;
    }

    public JLabel getJLabel9() {
        return jLabel9;
    }

    public void setJLabel9(JLabel jLabel9) {
        this.jLabel9 = jLabel9;
    }

    public JTextArea getJtDescripcion() {
        return jtDescripcion;
    }

    public void setJtDescripcion(JTextArea jtDescripcion) {
        this.jtDescripcion = jtDescripcion;
    }

    public Estadisticas getEst() {
        return Est;
    }

    public void setEst(Estadisticas Est) {
        this.Est = Est;
    }

    public String getUsuario() {
        return Usuario;
    }

    public void setUsuario(String Usuario) {
        this.Usuario = Usuario;
    }

    public Home getGc() {
        return gc;
    }

    public void setGc(Home gc) {
        this.gc = gc;
    }

    public JScrollPane getJScrollPane1() {
        return jScrollPane1;
    }

    public void setJScrollPane1(JScrollPane jScrollPane1) {
        this.jScrollPane1 = jScrollPane1;
    }

    public JButton getJbMenuPrincipal() {
        return jbMenuPrincipal;
    }

    public void setJbMenuPrincipal(JButton jbMenuPrincipal) {
        this.jbMenuPrincipal = jbMenuPrincipal;
    }

    public VerPerfilJugador getPj() {
        return pj;
    }

    public void setPj(VerPerfilJugador pj) {
        this.pj = pj;
    }

    public MediaSonido getSonidoLogin() {
        return sonidoLogin;
    }

    public void setSonidoLogin(MediaSonido sonidoLogin) {
        this.sonidoLogin = sonidoLogin;
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbMenuPrincipal;
    private javax.swing.JTextArea jtDescripcion;
    // End of variables declaration//GEN-END:variables

}
